<template>
  <!-- <div> -->
  <Dividelr>
    <template #left>
      <LBG :buttonList="lbuttonList" />
    </template>
    <template #right>
      <!-- <component :is="documentPage" /> -->
      <!-- <router-view/> -->
      <slot/>
    </template>
  </Dividelr>
  <!-- </div> -->
</template>
<script setup>
import { ref, onMounted, defineOptions } from "vue";
import useTagStore from '@/stores/tagList'
const tagStore = useTagStore();
import Dividelr from "@/layout/components/dividelr.vue";
import Dividetb from "@/layout/components/dividetb.vue";
import LBG from "@/components/ButtonGroup/leftButtonGroup.vue";
import FilterSearch from "@/components/TopTitleBox/FilterSearch.vue";
import router from "@/router";
// import MyFolder from "./pages/MyFolder.vue";
// import MyKnowledge from "./pages/MyKnowledge.vue";
// import MyBin from "./pages/MyBin.vue";
defineOptions({ name: "systemCom" });
// 按钮列表
const lbuttonList = ref([
  {
    label: "用户管理",
    icon: "userManage",
    type: "b2",
    active: true,
    // component: MyFolder,
    path: "/system/accountrManagement",
    onClick: () => {
      selectFunction("用户管理","/system/accountrManagement");
    },
  },
  {
    label: "日志管理",
    icon: "opeLogManage",
    type: "b2",
    active: false,
    // component: MyKnowledge,
    path: "/system/logManagement",
    onClick: () => {
      selectFunction("日志管理","/system/logManagement");
    },
  },
  {
    label: "备份与恢复",
    icon: "Recovery",
    type: "b2",
    active: false,
    // component: MyBin,
    path: "/system/backupAndRecovery",
    onClick: () => {
      selectFunction("备份与恢复","/system/backupAndRecovery");
    },
  },
]);
const documentPage = ref();

const selectFunction = (name, path) => {
  tagStore.refreshTagList(
    { name: null, breadcrumbName: null },
    { name: path, breadcrumbName: name, fullPath: path }
  );
  router.replace({ path });
  console.log(name, path, tagStore.tagList);
};
const searchCallBack = (word, time) => {
  console.log("搜索回调", word, time);
};
onMounted(() => {
  console.log("layout挂载完成");
});
</script>
